home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / string.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-05  |  2.5 KB  |  112 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3.     String.h
  4.     String handling
  5.     
  6.     Copyright Apple Computer,Inc.  1987-1990, 1993-1995
  7.     All rights reserved
  8.  
  9. ************************************************************/
  10.  
  11. /* Conditional Macros:
  12.  *    UsingStaticLibs    - for CFM-68K:  Insures that #pragma import is never used.
  13.  *    <none>            - for CFM-68K:    Insures that all functions and data items are
  14.  *                                    marked as library imports
  15.  */
  16.  
  17.  
  18. #ifndef __STRING__
  19. #define __STRING__
  20.  
  21. /*
  22.  * Get common declarations 
  23.  */
  24.  
  25. #include <NullDef.h>
  26. #include <SizeTDef.h>
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32.  
  33. #if defined (__CFM68K__) && !defined (UsingStaticLibs)
  34.     #pragma import on
  35. #endif
  36.  
  37. /*
  38.  *    Copying functions
  39.  */
  40.  
  41. void *memcpy (void *s1, const void *s2, size_t n);
  42. void *memmove (void *s1, const void *s2, size_t n);
  43. char *strcpy (char *s1, const char *s2);
  44. char *strncpy (char *s1, const char *s2, size_t n);
  45.  
  46. /* Apple library extentions.  The prefered mechanism for enabling these is by defining
  47.  * __useAppleExts__.  In the absence of this symbol, the __STDC__ symbol is used to 
  48.  * enable or disable these extentions. */
  49.  
  50. /* CFront can't handle the pretty version of this conditional 
  51. #if defined (__useAppleExts__) || \
  52.     ((defined (applec) && ! defined (__STDC__)) || \
  53.      (defined (__PPCC__) && __STDC__ == 0))
  54. */
  55. #if defined (__useAppleExts__) || ((defined (applec) && ! defined (__STDC__)) || (defined (__PPCC__) && __STDC__ == 0))
  56.  
  57. void *memccpy(void *s1, const void *s2, int c, size_t n);
  58.  
  59. #endif
  60.  
  61. /*
  62.  *    Concatenation functions
  63.  */
  64.  
  65. char *strcat (char *s1, const char *s2);
  66. char *strncat (char *s1, const char *s2, size_t n);
  67.  
  68. /*
  69.  *    Comparison functions
  70.  */
  71.  
  72. int memcmp (const void *s1, const void *s2, size_t n);
  73. int strcmp (const char *s1, const char *s2);
  74. int strcoll (const char *s1, const char *s2);
  75. int strncmp (const char *s1, const char *s2, size_t n);
  76. size_t strxfrm (char *s1, const char *s2, size_t n);
  77.  
  78.  
  79. /*
  80.  *    Search functions
  81.  */
  82.  
  83. void *memchr (const void *s, int c, size_t n);
  84. char *strchr (const char *s, int c);
  85. size_t strcspn (const char *s1, const char *s2);
  86. char * strpbrk (const char *s1, const char *s2);
  87. char *strrchr (const char *s, int c);
  88. size_t strspn (const char *s1, const char *s2);
  89. char *strstr (const char *s1, const char *s2);
  90. char *strtok (char *s1, const char *s2);
  91.  
  92.  
  93. /*
  94.  *    Miscellaneous functions
  95.  */
  96.  
  97. void *memset (void *s, int c, size_t n);
  98. char *strerror (int errnum);
  99. size_t strlen (const char *s);
  100.  
  101.  
  102. #if defined (__CFM68K__) && !defined (UsingStaticLibs)
  103.     #pragma import off
  104. #endif
  105.  
  106.  
  107. #ifdef __cplusplus
  108. }
  109. #endif
  110.  
  111. #endif
  112.